{include file="public/header" /}
<style type="text/css">
	.float-e-margins .btn{margin: 0!important;}
	.laydate-icon{background-image: none!important;}
	.choose_time{width: 80px;}
	td i{font-style: normal;}
	td img{cursor:pointer;width: 8rem;}
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>小区列表</h5>
        </div>
        <div class="ibox-content">
            <!--搜索框开始-->           
            <div class="row">
	                <form name="users" class="form-search form-inline" method="post" action="{:url('')}">
	                	<div  class="col-md-2">
		                    <div class="input-group" >  
		                        <a href="{:url('edit_plot')}"><button class="btn btn-outline btn-primary" type="button">添加小区</button></a> 
		                    </div>
		                </div>
						<div class="col-md-4">
							<div class="form-group">
						        <input class="form-control" type="text" name="tit" value="{if !empty($tit)}{$tit}{/if}"  placeholder="小区名模糊查询">
							</div>
						</div>
						<div class="col-md-2">
							<div class="form-group">
								<button class="btn btn-outline btn-primary" type="submit">
									<i class="fa fa-search"></i>搜索
								</button>
							</div>
						</div>
					  	<div class="col-md-1">
					  		<div class="form-group">
								<button class="btn btn-outline btn-primary" type="button"  onClick="export_excel();">导出数据</button>
							</div>
					  	</div>
	              </form>
            </div>
            <!--搜索框结束-->
            <div class="hr-line-dashed"></div>
            <div class="example-wrap">
                <div class="example">
                    <table class="table table-bordered table-hover">
                        <thead>
                            <tr class="long-tr">
                            	<th>名称</th>
                            	<th>首图</th>
                            	<th>地址</th>
                            	<th>简介</th>
                            	<th>经度</th>
                            	<th>纬度</th>
                            	<th>状态</th>
                            	<th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                    		{volist name="data" id="item" empty="$empty"}
                        	<tr class="long-td">
                        		<td>{$item.tit}</td>
                        		<td><img style="width:65px;height:55px" class="img-thumbnail" onerror="this.src='/static/admin/images/head_default.gif'" src="/uploads/images/{$item.head_img}"/></td>
                        		<td>{$item.address}</td>
                        		<td>{$item.decl}</td>
                        		<td>{$item.lng}</td>
                        		<td>{$item.lat}</td>
                        		<td>{:change_stat($item.id,$item.stat,'stat')}</td>
                        		<td>
                        			<a href="javascript:;" onclick="edit({$item.id})" class="btn btn-primary btn-outline btn-xs">
                                        <i class="fa fa-paste"></i> 编辑</a>&nbsp;&nbsp;
                                    <a href="javascript:;" onclick="del({$item.id})" class="btn btn-danger btn-outline btn-xs">
                                        <i class="fa fa-trash-o"></i> 删除</a>
                        		</td>
                        		
                        	</tr>
                        	{/volist}
                        </tbody>
                    </table>
                    <div style="text-align: right;">{$page}</div>
                </div>
            </div>
            <!-- End Example Pagination -->
        </div>
    </div>
</div>
<!-- End Panel Other -->
</div>
{include file="public/footer" /}

<script type="text/javascript">
   	$('img').on('click',function(){
   		var path=$(this).attr('src');
   		show_img(path);
   	});
   	function show_img(path){
   		layer.open({
			type:1,
			title:false,
			shadeClose:true,
			closeBtn:0,
			content:"<img class='img-thumbnail' src='"+path+"'>"
		});
   	}
 	//导出数据
// 	function export_excel(){
// 		window.location.href="{:url('Export/export_use_tag')}?status="+status+"&co_id="+co_id+"&stime="+stime+"&etime="+etime
// 	}
//展示程序数据
//function showprogram(nid){
//  location.href = './showprogram/nid/'+nid+'.html';
//}
//审核准租客
function check_idcard(id){
	layer.confirm('确认通过身份验证吗?', {icon: 3, title:'提示'}, function(index){
        $.getJSON('{:url("index/update_val")}', {'tab':'users','idname':'id','id':id,'key':'type','val':2 }, function(res){
            if(res.code == 1){
                layer.msg(res.msg,{icon:1,time:1500,shade: 0.1},function(){
              	window.location.reload();	
                });
            }else{
                layer.msg(res.msg,{icon:0,time:3000,shade: 0.1});
            }
        });
        layer.close(index);
    })
//	layer.open({
//		type:2,
//		title:false,
//		closeBtn:false,
//		shadeClose:true,
//		area: ['400px', '660px'],
//		content:"{:url('show_goods')}?id="+id
//	});
}
//编辑程序
function edit(id){
    location.href = "{:url('edit_plot')}?id="+id;
}
//
//更改VIP是否收费
function change_stat(_this,id,key){
    lunhui.change_stat(_this,'plot','id',id,key,'{:url("index/change_stat")}');
}
//删除
function del(id){
    lunhui.del('users','id',id,'del','{:url("index/del")}');
}
</script>
</body>
</html>